const express = require('express');
const {getUser} = require('./user.js')
const app = express();
const port =  3000;
app.use(express.json());

app.get('/', (req, res) => {
  res.send('Hello World!')
});
app.get('/geyao/user',async (req, res) => { 
    try {
        const result = await getUser()
        res.send(result)
    } catch (error) {
        res.status(500).send(error)
    }
})

app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`)
});